# !/usr/bin/python3
# -*- coding: utf-8 -*-

"""
岗位信息表模型类
----------------------------------------------------
@Project :   xinhou-openai-framework
@File    :   Post.py
@Contact :   sp_hrz@qq.com

@Modify Time      @Author    @Version    @Desciption
------------      -------    --------    -----------
2023/04/16 22:04  peng.shen   v1.0.0     None
"""

from datetime import datetime
from typing import Optional

from pydantic import BaseModel, Field


class ReqPostFindSchema(BaseModel):
    """
    岗位信息表参数&校验模型
    """

    id: Optional[int] = Field(
        default=None, title="岗位ID",
    )

    post_code: Optional[str] = Field(
        default=None, title="岗位编码",
    )

    post_name: Optional[str] = Field(
        default=None, title="岗位名称",
    )

    post_sort: Optional[int] = Field(
        default=None, title="显示顺序",
    )

    status: Optional[int] = Field(
        default=None, title="状态:1=正常,2=停用"
    )

    create_by: Optional[str] = Field(
        default=None, title="创建者",
    )

    created_at: Optional[datetime] = Field(
        default=None, title="创建时间",
    )

    update_by: Optional[str] = Field(
        default=None, title="更新者",
    )

    updated_at: Optional[datetime] = Field(
        default=None, title="更新时间",
    )

    remark: Optional[str] = Field(
        default=None, title="备注",
    )


class ReqPostSaveSchema(BaseModel):
    """
    岗位信息表参数&校验模型
    """

    post_code: Optional[str] = Field(
        title="岗位编码",
    )

    post_name: Optional[str] = Field(
        title="岗位名称",
    )

    post_sort: Optional[int] = Field(
        title="显示顺序",
    )

    status: Optional[int] = Field(
        default='1', title="状态:1=正常,2=停用",
    )

    create_by: Optional[str] = Field(
        title="创建者",
    )

    created_at: Optional[datetime] = Field(
        title="创建时间",
    )

    update_by: Optional[str] = Field(
        title="更新者",
    )

    updated_at: Optional[datetime] = Field(
        title="更新时间",
    )

    remark: Optional[str] = Field(
        title="备注",
    )


class ReqPostUpdateSchema(BaseModel):
    """
    岗位信息表参数&校验模型
    """

    id: int = Field(
        title="岗位ID",
    )

    post_code: Optional[str] = Field(
        default=None, title="岗位编码",
    )

    post_name: Optional[str] = Field(
        default=None, title="岗位名称",
    )

    post_sort: Optional[int] = Field(
        default=None, title="显示顺序",
    )

    status: Optional[int] = Field(
        default=None, title="状态:1=正常,2=停用",
    )

    create_by: Optional[str] = Field(
        default=None, title="创建者",
    )

    created_at: Optional[datetime] = Field(
        default=None, title="创建时间",
    )

    update_by: Optional[str] = Field(
        default=None, title="更新者",
    )

    updated_at: Optional[datetime] = Field(
        default=None, title="更新时间",
    )

    remark: Optional[str] = Field(
        default=None, title="备注",
    )


class ResPostDetailSchema(BaseModel):
    """
    岗位信息表参数&校验模型
    """

    id: Optional[int] = Field(
        default=None, title="岗位ID",
    )

    post_code: Optional[str] = Field(
        default=None, title="岗位编码",
    )

    post_name: Optional[str] = Field(
        default=None, title="岗位名称",
    )

    post_sort: Optional[int] = Field(
        default=None, title="显示顺序",
    )

    status: Optional[int] = Field(
        default=None, title="状态:1=正常,2=停用"
    )

    create_by: Optional[str] = Field(
        default=None, title="创建者",
    )

    created_at: Optional[datetime] = Field(
        default=None, title="创建时间",
    )

    update_by: Optional[str] = Field(
        default=None, title="更新者",
    )

    updated_at: Optional[datetime] = Field(
        default=None, title="更新时间",
    )

    remark: Optional[str] = Field(
        default=None, title="备注",
    )
